package com.lx.zy.project.system.controller;

import com.lx.zy.framework.web.controller.BaseController;
import com.lx.zy.framework.web.domain.AjaxResult;
import com.lx.zy.project.system.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: zy-vue
 * @description: 数据字典信息
 * @author: Lx
 * @create: 2019-11-04 17:46
 **/
@RestController
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
    @Autowired
    private ISysDictDataService dictDataService;

    /**
     * 根据字典类型查询字典数据信息
     */
    @PreAuthorize("@ps.hasPermi('system:dict:query')")
    @GetMapping("/dictType/{dictType}")
    public AjaxResult dictType(@PathVariable String dictType)
    {
        return AjaxResult.success(dictDataService.selectDictDataByType(dictType));
    }
}
